package com.xian.ai.code.model.dto.user;

import com.xian.ai.code.model.entity.User;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.io.Serializable;

/**
 * @ClassName UserLoginRequest
 * @Description TODO
 * @Author Zhangxn
 * @Version 1.0
 */
@Data
@AllArgsConstructor
public class UserLoginRequest implements Serializable {

    private static final long serialVersionUID = 3191241716373120793L;

    /**
     * 账号
     */
    private String userAccount;

    /**
     * 密码
     */
    private String userPassword;

    public static UserLoginRequest fromEntity(User entity){
        return new UserLoginRequest(entity.getUserAccount(), entity.getUserPassword());
    }
}
